package classes.model
{
	import mx.resources.ResourceBundle;
	import mx.resources.ResourceManager;
	
	[Bindable]
	public class ResourceBundleManager
	{		
		[ResourceBundle("mainBundle")]
		private static var rb:ResourceBundle;

		public static const BUNDLE_MAIN : String = "mainBundle";

		private static var instantiated : Boolean = false;		

		public static var bundleName : String = BUNDLE_MAIN;
								
		public function ResourceBundleManager()
		{
		}
		
		public static function getString(resourceString : String) : String
		{						
			if (ResourceManager.getInstance().getResourceBundle("en_US", "mainBundle") == null)
			{
				ResourceManager.getInstance().addResourceBundle(rb);
			}
			
			var value : String = ResourceManager.getInstance().getString(ResourceManager.getInstance().getResourceBundle("en_US", "mainBundle").bundleName, resourceString, null, ResourceManager.getInstance().getResourceBundle("en_US", "mainBundle").locale); 
			return value;
		}
	}
}